package com.cloudcc.mobile.adapter;

import android.content.Context;

import com.cloudcc.cloudframe.adapter.CommonAdapter;
import com.cloudcc.cloudframe.adapter.NewCommonAdapter;
import com.cloudcc.cloudframe.adapter.ViewHolder;
import com.cloudcc.mobile.R;
import com.cloudcc.mobile.entity.TianYanEntity;

/**
 * Created by lin on 2017/7/24.
 */

public class NearByListTianAdapter extends NewCommonAdapter {
    public NearByListTianAdapter(Context mContext) {
        super(mContext);
    }

    @Override
    public void convert(ViewHolder holder, Object o, int position) {
        TianYanEntity.DataBean dataBean = (TianYanEntity.DataBean) o;
        String names = dataBean.getName().replaceAll("<em>","");
        names = names.replaceAll("</em>","");
        holder.setText(R.id.near_by_list_item_name , (position+1)+"."+names);
//        holder.setText(R.id.near_by_list_item_long , dataBean);
        holder.setText(R.id.near_by_list_item_address , dataBean.getRegLocation());
    }


    @Override
    public int getLayoutId() {
        return R.layout.near_by_list_item;
    }
}
